#python string-programs
Explore tagged Tumblr posts
Text
you're just NOW telling me python has a built-in method named maketrans() ???? I can make a string trans?
#this is a good thing. I am pleased with this#especially with how python uses the self keyword for object oriented programming#self.gender.maketrans() I think is a valid line of code#assuming you have a string named gender declared earlier in the program#python#programming#trans#transgender
6 notes
·
View notes
Text
Reversing a string is an important concept across multiple domains. Below are some of the important reasons to know the significance of reversing a string.
0 notes
Text
Python String Concatenation: A Complete Guide
String concatenation is a fundamental concept in Python that allows you to combine two or more strings into one. This simple yet powerful technique is essential for various programming tasks, from creating dynamic text to managing user input. In this article, we’ll explore how to concatenate strings in Python, ensuring it’s easy to understand and highly optimized for SEO to help it rank first on…

View On WordPress
#Coding Tutorials#Computer Engineering#programming#Python#String Concatenation#Study Engineering#Technology
1 note
·
View note
Text
op you speak to my soul
bitch java is so fucking annoying why does the S in String need to be capitalized but the i in int has to be in lowercase??? why do you need to import a whole ass module just to take an input from the user??? why are all the commands so fucking long and hard to remember??? JUST DIE
#i can never frickin remember what the heck to do in my java code#the S in String still pisses me off#and exactly why do i need to import a whole module#mean python: a=input()#now that's what i call short and sweet ^^#im forever going go have a love hate relationship with java#java#codeblr#coding#computer science#java code#java developer#programming languages#programming#code#comp sci#app dev
138 notes
·
View notes
Text
What kind of bubble is AI?

My latest column for Locus Magazine is "What Kind of Bubble is AI?" All economic bubbles are hugely destructive, but some of them leave behind wreckage that can be salvaged for useful purposes, while others leave nothing behind but ashes:
https://locusmag.com/2023/12/commentary-cory-doctorow-what-kind-of-bubble-is-ai/
Think about some 21st century bubbles. The dotcom bubble was a terrible tragedy, one that drained the coffers of pension funds and other institutional investors and wiped out retail investors who were gulled by Superbowl Ads. But there was a lot left behind after the dotcoms were wiped out: cheap servers, office furniture and space, but far more importantly, a generation of young people who'd been trained as web makers, leaving nontechnical degree programs to learn HTML, perl and python. This created a whole cohort of technologists from non-technical backgrounds, a first in technological history. Many of these people became the vanguard of a more inclusive and humane tech development movement, and they were able to make interesting and useful services and products in an environment where raw materials – compute, bandwidth, space and talent – were available at firesale prices.
Contrast this with the crypto bubble. It, too, destroyed the fortunes of institutional and individual investors through fraud and Superbowl Ads. It, too, lured in nontechnical people to learn esoteric disciplines at investor expense. But apart from a smattering of Rust programmers, the main residue of crypto is bad digital art and worse Austrian economics.
Or think of Worldcom vs Enron. Both bubbles were built on pure fraud, but Enron's fraud left nothing behind but a string of suspicious deaths. By contrast, Worldcom's fraud was a Big Store con that required laying a ton of fiber that is still in the ground to this day, and is being bought and used at pennies on the dollar.
AI is definitely a bubble. As I write in the column, if you fly into SFO and rent a car and drive north to San Francisco or south to Silicon Valley, every single billboard is advertising an "AI" startup, many of which are not even using anything that can be remotely characterized as AI. That's amazing, considering what a meaningless buzzword AI already is.
So which kind of bubble is AI? When it pops, will something useful be left behind, or will it go away altogether? To be sure, there's a legion of technologists who are learning Tensorflow and Pytorch. These nominally open source tools are bound, respectively, to Google and Facebook's AI environments:
https://pluralistic.net/2023/08/18/openwashing/#you-keep-using-that-word-i-do-not-think-it-means-what-you-think-it-means
But if those environments go away, those programming skills become a lot less useful. Live, large-scale Big Tech AI projects are shockingly expensive to run. Some of their costs are fixed – collecting, labeling and processing training data – but the running costs for each query are prodigious. There's a massive primary energy bill for the servers, a nearly as large energy bill for the chillers, and a titanic wage bill for the specialized technical staff involved.
Once investor subsidies dry up, will the real-world, non-hyperbolic applications for AI be enough to cover these running costs? AI applications can be plotted on a 2X2 grid whose axes are "value" (how much customers will pay for them) and "risk tolerance" (how perfect the product needs to be).
Charging teenaged D&D players $10 month for an image generator that creates epic illustrations of their characters fighting monsters is low value and very risk tolerant (teenagers aren't overly worried about six-fingered swordspeople with three pupils in each eye). Charging scammy spamfarms $500/month for a text generator that spits out dull, search-algorithm-pleasing narratives to appear over recipes is likewise low-value and highly risk tolerant (your customer doesn't care if the text is nonsense). Charging visually impaired people $100 month for an app that plays a text-to-speech description of anything they point their cameras at is low-value and moderately risk tolerant ("that's your blue shirt" when it's green is not a big deal, while "the street is safe to cross" when it's not is a much bigger one).
Morganstanley doesn't talk about the trillions the AI industry will be worth some day because of these applications. These are just spinoffs from the main event, a collection of extremely high-value applications. Think of self-driving cars or radiology bots that analyze chest x-rays and characterize masses as cancerous or noncancerous.
These are high value – but only if they are also risk-tolerant. The pitch for self-driving cars is "fire most drivers and replace them with 'humans in the loop' who intervene at critical junctures." That's the risk-tolerant version of self-driving cars, and it's a failure. More than $100b has been incinerated chasing self-driving cars, and cars are nowhere near driving themselves:
https://pluralistic.net/2022/10/09/herbies-revenge/#100-billion-here-100-billion-there-pretty-soon-youre-talking-real-money
Quite the reverse, in fact. Cruise was just forced to quit the field after one of their cars maimed a woman – a pedestrian who had not opted into being part of a high-risk AI experiment – and dragged her body 20 feet through the streets of San Francisco. Afterwards, it emerged that Cruise had replaced the single low-waged driver who would normally be paid to operate a taxi with 1.5 high-waged skilled technicians who remotely oversaw each of its vehicles:
https://www.nytimes.com/2023/11/03/technology/cruise-general-motors-self-driving-cars.html
The self-driving pitch isn't that your car will correct your own human errors (like an alarm that sounds when you activate your turn signal while someone is in your blind-spot). Self-driving isn't about using automation to augment human skill – it's about replacing humans. There's no business case for spending hundreds of billions on better safety systems for cars (there's a human case for it, though!). The only way the price-tag justifies itself is if paid drivers can be fired and replaced with software that costs less than their wages.
What about radiologists? Radiologists certainly make mistakes from time to time, and if there's a computer vision system that makes different mistakes than the sort that humans make, they could be a cheap way of generating second opinions that trigger re-examination by a human radiologist. But no AI investor thinks their return will come from selling hospitals that reduce the number of X-rays each radiologist processes every day, as a second-opinion-generating system would. Rather, the value of AI radiologists comes from firing most of your human radiologists and replacing them with software whose judgments are cursorily double-checked by a human whose "automation blindness" will turn them into an OK-button-mashing automaton:
https://pluralistic.net/2023/08/23/automation-blindness/#humans-in-the-loop
The profit-generating pitch for high-value AI applications lies in creating "reverse centaurs": humans who serve as appendages for automation that operates at a speed and scale that is unrelated to the capacity or needs of the worker:
https://pluralistic.net/2022/04/17/revenge-of-the-chickenized-reverse-centaurs/
But unless these high-value applications are intrinsically risk-tolerant, they are poor candidates for automation. Cruise was able to nonconsensually enlist the population of San Francisco in an experimental murderbot development program thanks to the vast sums of money sloshing around the industry. Some of this money funds the inevitabilist narrative that self-driving cars are coming, it's only a matter of when, not if, and so SF had better get in the autonomous vehicle or get run over by the forces of history.
Once the bubble pops (all bubbles pop), AI applications will have to rise or fall on their actual merits, not their promise. The odds are stacked against the long-term survival of high-value, risk-intolerant AI applications.
The problem for AI is that while there are a lot of risk-tolerant applications, they're almost all low-value; while nearly all the high-value applications are risk-intolerant. Once AI has to be profitable – once investors withdraw their subsidies from money-losing ventures – the risk-tolerant applications need to be sufficient to run those tremendously expensive servers in those brutally expensive data-centers tended by exceptionally expensive technical workers.
If they aren't, then the business case for running those servers goes away, and so do the servers – and so do all those risk-tolerant, low-value applications. It doesn't matter if helping blind people make sense of their surroundings is socially beneficial. It doesn't matter if teenaged gamers love their epic character art. It doesn't even matter how horny scammers are for generating AI nonsense SEO websites:
https://twitter.com/jakezward/status/1728032634037567509
These applications are all riding on the coattails of the big AI models that are being built and operated at a loss in order to be profitable. If they remain unprofitable long enough, the private sector will no longer pay to operate them.
Now, there are smaller models, models that stand alone and run on commodity hardware. These would persist even after the AI bubble bursts, because most of their costs are setup costs that have already been borne by the well-funded companies who created them. These models are limited, of course, though the communities that have formed around them have pushed those limits in surprising ways, far beyond their original manufacturers' beliefs about their capacity. These communities will continue to push those limits for as long as they find the models useful.
These standalone, "toy" models are derived from the big models, though. When the AI bubble bursts and the private sector no longer subsidizes mass-scale model creation, it will cease to spin out more sophisticated models that run on commodity hardware (it's possible that Federated learning and other techniques for spreading out the work of making large-scale models will fill the gap).
So what kind of bubble is the AI bubble? What will we salvage from its wreckage? Perhaps the communities who've invested in becoming experts in Pytorch and Tensorflow will wrestle them away from their corporate masters and make them generally useful. Certainly, a lot of people will have gained skills in applying statistical techniques.
But there will also be a lot of unsalvageable wreckage. As big AI models get integrated into the processes of the productive economy, AI becomes a source of systemic risk. The only thing worse than having an automated process that is rendered dangerous or erratic based on AI integration is to have that process fail entirely because the AI suddenly disappeared, a collapse that is too precipitous for former AI customers to engineer a soft landing for their systems.
This is a blind spot in our policymakers debates about AI. The smart policymakers are asking questions about fairness, algorithmic bias, and fraud. The foolish policymakers are ensnared in fantasies about "AI safety," AKA "Will the chatbot become a superintelligence that turns the whole human race into paperclips?"
https://pluralistic.net/2023/11/27/10-types-of-people/#taking-up-a-lot-of-space
But no one is asking, "What will we do if" – when – "the AI bubble pops and most of this stuff disappears overnight?"
If you'd like an essay-formatted version of this post to read or share, here's a link to it on pluralistic.net, my surveillance-free, ad-free, tracker-free blog:
https://pluralistic.net/2023/12/19/bubblenomics/#pop
Image: Cryteria (modified) https://commons.wikimedia.org/wiki/File:HAL9000.svg
CC BY 3.0 https://creativecommons.org/licenses/by/3.0/deed.en
--
tom_bullock (modified) https://www.flickr.com/photos/tombullock/25173469495/
CC BY 2.0 https://creativecommons.org/licenses/by/2.0/
4K notes
·
View notes
Text
*screaming*
*continued screaming*
Okay. So. My introductory Visual C# class.
The professor for that class was Alice. Alice was the person who spoke in the introductory video and the person who we were supposed to email if we had any issues.
But all of the assignments, lectures, and quizzes were written and delivered by Bob. On the youtube channel "Bob's programming academy." The quizzes included Bob's name, like "if you do X will it return the string ProfessorBob, Professor, Bob, or Professor.Bob?"
This class was really frustrating for me because it was structured in such a way that you could easily pass the class with zero knowledge of the subject - it was totally based on quizzes that you could take an unlimited number of times and we *had* weekly programming assignments but they weren't graded so there was no incentive to do them (and look, if I wanted to teach myself programming with no incentives I could fail for several years to do that on my own, I don't need to pay fifty bucks a unit for that; the reason I am in a *class* and am not self-taught is because I need external motivation. That's why I sought out a class).
Also when there *was* a problem with an instruction that was unclear in one of the videos for the assignments, or if I thought I'd done something correctly that was very much incorrect, it wasn't Alice who had created the instructions, it was Bob - in 2017 no less - and I didn't really feel like I could ask Alice for help with an ungraded assignment that she hadn't written.
So. Now. My Python class.
Today is the first day of class. Professor is Charles.
I go to the mandatory attendance quiz and it is word-for-word the same mandatory attendance quiz as the C# class, down to the final question "what is your personal email address so I can keep in contact with you after the semester?"
I look at the syllabus.
Class grade is based on quizzes. We have assignments but none of them are graded. There's no textbook, just a series of videos from Professor Bob's Programming Academy.
So I'd been toying with staying at this school and trying to take more CS classes instead of going to another school, just to try to keep my records easier to manage, but since it seems like that *ENTIRE DEPARTMENT* is five Professor Bobs in a trenchcoat, I will probably be going somewhere else (and once again trying to force myself to do projects that I already know are *good for me to do* but *useless for the class and a massive time suck*)
I should drop this class. I should drop this class and apply for the other school so that I can start taking classes there in the spring because if I take this class and then go into the object oriented programming class in the spring and it's another professor bob sock puppet and I end up taking twelve units of programming classes where all I learn is how to google answers in a short time frame (something I already know how to do thanks) I am going to fucking lose it.
Also, again: I have a Bachelor's Degree. I spent five years at a community college when I was getting that degree. I took probably a dozen online classes starting in 2005 and going until 2011 in the process of getting that degree.
THIS bullshit, this "I'm your professor but actually I'm not and all the materials were created by someone else in the department or came directly from the textbook publisher and there is no writing and there are no assignments everything is multiple choice quizzes that are automatically graded" is *dogshit.*
This is NOT how online classes worked back in my day, not even online math classes, and as much as I know adjuncts are getting fucked over by academia in general, this isn't something that these professors should be getting paid as much as they are to do. Alice checked whether or not students turned in a hello world assignment and gave a pass/fail grades for three discussion boards that were responses to youtube videos. Nothing else in the class required her input. If this is the level of instruction that students are getting then the class is already automated and the students shouldn't have to pay for it.
This is crap. This is an incredible level of crap.
908 notes
·
View notes
Text
@selemchant @noxconsortium
Here's a breakdown of what I did
I went through the ">conversations" section, looking for which files actually made up the dialogue trees. It's a little different than Inquisition, but I eventually found that they seem to be within the "FC_ConvFlowLayer" files.
Frosty actually has the strings linked correctly within these files, but it's very cumbersome to look at in Frosty. I wanted to make it easier to read. When you export these FC_ConvFlowLayer files, they are .xml files that link to numbers instead of strings.
When you export the raw script of DAV from Frosty Editor, every line is paired with the same matching little numbers (minus the first "0x" for some reason).
The raw script is a .csv file that looks like this:
So I added an "0x" to every line of the .csv file (so they would match) and then made a python program that found all the strings within the <StringId></StringId> tags in all the xml files, and then looked up the matching number in the Raw Script .csv file and then saved the second column (the text) from the .csv file into the .xml files.
So now instead of numbers, I have strings:
Now, these .xml files have a lot of information in them that someone smarter than me could figure out how to make a comprehensive dialogue tree out of, because I think all of the information you would need is provided by the xml files. But that's hard and for now I just wanted a .txt file of who spoke what line.
It wasn't hard from there to write another little program to extract just the speaker and the lines into a plain .txt file
And then to merge all the text files together and use notepad++ and the power of regular expressions to clean them even more:
IF YOU WOULD LIKE TO PLAY AROUND WITH THE .XML FILES THAT HAVE THE NUMBERS REPLACED WITH STRINGS but that still have all the conversation information intact, like how each of the lines are linked to each other, I uploaded them here on google drive (there are 1500 files, but they're pretty small):
LINK TO THE XML FILES FOR YOU TO DO WHAT YOU WANT WITH
#Dragon Age#Veilguard spelunking#Veilguard spoilers#DA4 spoilers#long post#sorry I used a spoilery example lmao
58 notes
·
View notes
Text
Part 2 of a Computer Science student's analysis of the FNAF: SB intro
Full with tech lingo, abundant personal interpretations, and translations so that my tech illiterate fellas may undertand whatever the fuck im yapping about!
This post is written under the context that you've read my last analysis. I highly recommend you first check out these two posts before continuing with this one if you haven't already: > First post + Continuation ( IMPORTANT!! ) > An addition to the first post
Once you've read through those two (three?) posts, come back here! You're back? You've read them? Awesome! Let's begin then. =)
Reminder! This analysis has been done based off of my own understanding of the subject of both computing and programming - which I am currently studying. I would also like to yet again shout out this reddit post, that also gives a great perspective. Definitely check it out if you're interested later!
Also I have not re-read this, you may find typos - don't hold it against me, they will be fixed, someday =(
Now then, fellas, this is where shit gets wild.
Last post, I talked about the command box we can see at the top right corner of the intro - what each command did and how it basically corresponded to what happens to freddy in the events of the intro.
However, you might recall I mentioned a second command box, the one found at the left side of the screen. This command box is by far the most important piece of information we have throughout the entire duration of the intro. Mostly, because it changes 3 times.
It changes a total of 3 times in the time it takes for the right command box to finish.
Each time it changes, it displays new lines of code. And every single line of code it displays, tells us a lot about what is happening to Freddy.
This is the first block of code that we get:
system32> Get-568_win heat_869%yTnu_bl8 lvl_b> 228.wst serial.dot_btb rec.556> dtd /
You might inmediately realize that the first line of code from this command box matches exactly the one from the first analysis. Here are both of them as comparison.
Hopefully, you've already made the connection. This command box is the one possibly being run by the Glitchtrap/Vanny Virus. Whatever lines of code appear on the command box to the left, are the ones being executed by the Virus - and they affect Freddy in real time. However, the command box on the right ir Freddy's, so to speak.
Both CLI (command line interfaces) are being run at the same time - yet independently of one another. Keep this in mind.
I don't want to go too in depth with this first block of code. All you need to know is that it moves around some directories and runs something called 'dtd', wich could be a command or a program.
The next two blocks of code, however? Ohhh damn... This is it, fellas. This is what I've been waiting for.
Now, I want you to know that this doesn't quite resemble any 'real' code, at least not at first glance. I do believe that it is a very 'condensed' form of the Python programming language, since the syntaxing of the commands shown here somewhat resemble how a string written in Python would look like.
So, I have taken the time to try to decipher what each line means, and what they do. And well, let's just say it explains why Freddy wasn't affected by the Virus in the first place.
def rule(x) return warning78 init; self_overdrive abort(3)RTLKt abort(5)XGE END
This is the second block of code that we're shown, so lets break it down.
def rule(x) return warning78 init;
This string would define "rule" as a function, specifying "x" as the parameter. Basically, this line specifies that if the command rule is inputted, it should return whatever value (or argument) x has taken.
Normally, define is followed by a return function, which is why I've shown them together, as well as the init; command.
The command return followed by "warning78", makes it so whenever we call upon the function rule, it shows us whatever warning78 may be - and judging as to what happens in the intro, it could be any of the multiple warnings that appear in Freddy's GUI. Or it could also easily be the big "WARNING!" message that can be seen the entire time near the top of the screen.
Lastly, the init; command isn't exactly a standardized python command - but it is a common abreviation of the initialization command, where in the field of programming, it means "the assignment of an initial value for a data object or variable". Basically, it's when you assign the initial values and variables to a program so it can start.
All in all, these three lines create a command that, when called upon, gives out the warning78.
self_overdrive
Again, not really a python function, but important nontheless. This command doesn't have a specific meaning, but we can try to understand what it does.
The term overdrive doesn't really exist in the field of computing/programming. However, it is asociated with overclocking - "the practice of increasing the clock rate of a computer to exceed that certified by the manufacturer" - Overdrive is also a term in the field of music, also known as distorsion, which is when you force an amplifier to output past its limits.
Both of these definitions go around the same concept, pushing a computer to its limits so that it works better, or faster - even while it possibly damages the computer.
We can then assume that the function self_overdrive is making Freddy's system run pasts its usual limits. Which is why I believe Freddy's integrity level plumits during the intro.
abort(3)RTLKt abort(5)XGE END
Lastly, we have these three lines.
The abort function isn't a real python function - but I believe you can asume what it does. Both lines are attempting to kill something - a program, a process, another function... However, I am not sure wether these two are really functions, since they could very easily be error handling messages. Essencially, warning messages that the system returns when something crashes, for example.
The last line, END, specifies the end of this string of code.
Which leads us to the third and last block of code. The one which in my professional opinion, is the one that reveals to us why Freddy's cool with us during Security Breach! =]
report.NULL gridlock [ax674] init_task>void alloc [overload] SW.failure return /
THIS IS WHAT WE'VE BEEN WAITING FOR, FRIENDS. THIS IS IT. This is the part where I had the most fun with this analysis...
report.NULL
Now, usually report, in the field of programming and software, it means to record or log something. For example an error log, or crash log. However, it being followed by NULL could also mean that this is an error handling message of sorts.
In computing, Null is, well, zero. It's nothing. It's the absence of value, when something that should be there, isn't.
From this, we could gather that this is a warning message that attempted to report something, yet failed to find anything to report back. No value at all.
...or, we could take this line literally. Taking into consideration that this code is being executed by the virus - this line of code could be taken as an attempt by the virus to stop Freddy's system from freaking out.
Remember that this entire code is being executed as Freddy's actively getting a big flashing WARNING! message. So, this line of code could be an effort to silence it, returning a null value to a warning message.
Both scenarios are plausible, so stick with the one you think fits best!
gridlock [ax674]
This one... man... this line was wild. It's where everything clicked for me. You will want to ignore the characters [ax674], what we truly care about is the first word: gridlock.
You see, a gridlock isn't really a term used in computing at all. It is a term refering to a "severe congestion of traffic, where continuous queues of vehicles block an entire intersection". HOWEVER, gridlock is also known as another term for deadlock.
A deadlock is what's known as a stalemate. A situation where two opposing parties come to a point where no progress can be made. In programming, it means basically the same thing.
A situation where two processes can't proceed, since both of them are waiting for the other to release a resource. Now, imagine this scenario. We have two processes, A and B, and two resources, R1 and R2.
Process A is currently using resource R1.
Process B is currently using resource R2.
Process A requests resource R2, but is blocked because it's held by Process B.
Process B requests resource R1, but is blocked because it's held by Process A.
Now... imagine this situation, but with Freddy, and the virus.
What we most likely have here, the line gridlock [ax674], is an error handling message, warning that a deadlock is ocurring. The string of characters beside it has no meaning, and could easily be but an error handling code of sorts.
init_task>void
I've explained before that init is the abreviation of initialization. So, we can gather that this is a command that is attempting to initialize a task. Now then, in the context of the previous line, this one could mean one of two things:
The virus is attempting to initialize a task (a set of instructions) called void.
The virus is attempting to initialize a task, however, due to the deadlock, it returns this line as an error message, indicating a void return. In programming, when a function returns the word void, it usually means that the function was not able to return a value. It is similar to Null, yet not the same.
Either of these could be a posibility, so I will leave it to your personal interpretation.
And here it when it all goes to hell...
alloc [overload] SW.failure return
Alloc is not a real function, but it can be considered an abreviation of the word allocation. In computing, the allocation is the assignment of memory and resources to the various processes the system may have.
Proper memory and resource allocation is very important in a computer. As you may know, a computer as a limited amount of RAM it can work with, and the same goes for it's processing power. But, for example, what happens when you try to allocate resources that aren't available?
Well, a lot of things may happen. Mainly, the program could hang, the process could freeze - or the entire system could crash!
Remember earlier, we saw that it was likely that Freddy and the virus were in a deadlock. Yet, the Virus tried to allocate more resources to itself... Which overloaded the system, and likely resulted in the next line.
SW.failure has no real meaning - but I've interpreted the first two characters [SW] as software. This would make this line an error message warning about a software failure.
So... What does this all mean? How does it all tie together? Why didn't Freddy get infected by the Virus? Because it got too greedy. It tried to allocate too many resources/memory, overloaded the system and crashed both itself and Freddy.
Why only Freddy, though? Why didn't this happen to the other animatronics? That... I'm not sure. I believe this is more of a lore question rather than computer question.
In my opinion, I don't think this was a case of 'Freddy knew that he was getting infected by a virus, and fought back'. I'm leaning more to the posibility of it being a 'wrong place wrong time' type of situation... or maybe 'right place right time'? In general, a lot of factors and a lot of different things happened that lead to this specific scenario happening.
Anyways, this is it! This has been my analysis - or nerdy infodumping, if you please.
I do hope that I was able to teach you something today, and that this whole analysis helps you understand the animatronics a bit better - and helps you with future fanfics, comics, AUs, artworks... whatever!
One last reminder - if you have any more questions about this stuff, my ask box is open! I love talking about this stuff!!
Oh, and, coming soon...
DJMM's Bouncer Mode ! A theory by a computer science student as to why it's still present, and why it makes him so aggressive.
#oh god is this post too long?#i hope this doesn't crash anyones phone im so sorry#anyways yea. DJMM bouncer mode explained coming soon#not me being a computer nerd AGAIN?#fnaf#fnaf sb#fnaf security breach#five nights at freddy's#security breach#snailsnarks#fnaf djmm#fnaf dj music man
96 notes
·
View notes
Note
Hey new moot ^^ What's your favourite programming language? Or programming style if you only really use one lang
I am a python/micropython girly
And as for style, I write my code almost entirely in functions, my main loop code is just calling a massive string of functions
Its real nice and neat and i take pride in that :3
9 notes
·
View notes
Note
What exactly makes Rust so great? (asking as a newbie who's mostly familiar with C and Python)
i'll answer this purely within the scope of my personal use of it and why i like it
for starters you can basically do any type of programming task in it (although some stuff like gamedev is in pretty early stages and i wouldn't really recommend it unless you really like rust lol), so it's really easy to reach for it instead of another programming language in basically any situation
then the reason i'd pick it over languages is that it's just a really nice programming language to use for too many reasons to list really, it has really good compiler errors, it does nice stuff with memory management, it handles a lot of common stuff like strings really well, it has pretty much the best build system i've used packed in, built in unit testing, good support for functional style code, i love the way it does enums, all sorts of stuff
it's got a bit of a learning curve to start with and probably isn't a great first or even second programming language but once you get used to it it's really quite nice to use
(this isn't to say it doesn't have any problems of course, lack of reflection without hacky proc macro stuff for instance, it just has a lot of really nice stuff)
11 notes
·
View notes
Text
Pixel Cat's End Bean Calculator
As a few of you may be aware (also I have pinged those who expressed interest in the first post btw) I have created a calculator that takes the genetic strings of two not-cats, along with some filters, and returns EVERY. POSSIBLE. BEAN. along with its corresponding probability! It also displays the total probability of matching all input traits.
The link to the file is here. (Current version: 1.0)
In order to use it, you will need a python interpreter (there are plenty of guides for that online, it shouldn't be hard to do) along with a program to run it in. I chose and recommend Visual Studio Code. Again, there are plenty of guides for python and VS Code.
At the top of the file, there are some settings that you can change, including fonts and colours, with the formats needed for those settings next to them. You can change those whenever, but be warned that changing font size may result in the window being weirdly sized.
Basically, to use it, you just run the code, input the full genetic strings (if growth or accent are unknown, put [??] in its place) of a North/Trade cat and a South/Trade cat in their respective fields, select the traits you want to see, and click the Big Red Button™. From there, you can see every possible bean, its chance, and at the bottom will be the chance of a bean matching your selected traits.
Note that for recessives (for example longhair), carrying the trait and not carrying it are two separate fields (short and short (carries long)). If you want the overall chance for shorthair, you would add the chances for short and short (carries long).
There is a button at the bottom for if there are any bugs that you have found, along with some troubleshooting steps to fix them.
If you have any more questions, feel free to ask!
Those who expressed interest earlier: @fr-thrice @tvthetv
5 notes
·
View notes
Note
#The Cute/Pawesome Self Awareness Identifier/Rectifier 9000 #this program will search through fenFacts.txt to check if Fen thinks it is pawesome and cute and then to rectify the situation if it doesn't. #first step, open the file in read mode and set up an empty array to copy each line fenFactsFile = open('fenFacts.txt' , 'r') newFenFactsStringArray = [] #now let's set up our variables to check if Fen already thought it was Cute/Pawesome and/or if it thought it wasn't. cute = False pawesome = False #now to blitzing through through this data. Python has built in functionality to read through lines in a file using a for loop like "for line in file:" where line is the current line of the file so let's just use that for currentLine in fenFactsFile: #loop code starts here. Our comparison strings have the "\n" at the end because we're not stripping these. let's check to see if it thinks it is NOT Cute or Pawesome first. if currentLine == "Is not pawesome.\n": print("I was wrong and thought I was not pawesome ~w~"); #we don't want to keep a wrong fact in our new array so let's skip over to the next iteration of the loop using continue to skip the rest of the code in the loop continue
if currentLine == "Is not cute.\n": print("I wrong and thought I was not cute."); #we don't want to keep a wrong fact in our new array so let's skip over to the next iteration of the loop using continue to skip the rest of the code in the loop continue #Now the cute check if currentLine == "Is cute.\n": cute = True print("I already knew I was cute!"); #now for the pawesome check if currentLine == "Is Pawesome.": pawesome = True print("I already knew I was pawesome ^w^"); #final part of the for loop is to append to our new Fen facts array
newFenFactsStringArray.append(currentLine) #end of the for loop here
#end of reading, we got our checks done. Time to close the file fenFactsFile.close() #Now let's see if we cute or pawesome are still false if cute == False: #it does not recognise its own cuteness. We can fix this. newFenFactsStringArray.append("Is cute.\n") if pawesome == False: #it does not recognise its own pawesomeness. We can fix this newFenFactsStringArray.append("Is pawesome.\n") #Now we have all the Fen Facts we want in newFenFactsStringArray so let's open up fenFacts.txt in write mode and get it fixed up with the cute and pawesome lines but without the is not cute or is not pawesome lines fenFactsFile = open('fenFacts.txt' , 'w') #the next line will replace the text in fenFacts.txt with our newFenFactsStringArray fenFactsFile.writelines(newFenFactsStringArray) #closing it for real this time fenFactsFile.close()
——————
I was wrong and thought I was not pawesome ~w~
I was wrong and thought I was not cute.
#beep boop#asks#I’m not gonna lie the most fun part of this was interpreting the python code it’s genuinely decent practice for me lol#*.zip
14 notes
·
View notes
Text
I am remembering things about this generator. First off:
FinalRelationshipValue="{} {} (a {} {} {}), {} (a {} {}) and {} (a {}). One time, {} {} {}, who {} it. "
I'm remembering how silly strings look without their added data in them. Like, yep, that sure is a statement :) Such a valid sentence.
Also, with the disorders, I forgot that I researched statistics for things like "percentage of people missing an arm" and used that in the generator. Your guy has a 4 in 10,000 chance to be missing an arm, and a 28 in 1000 chance to have ADHD. Where did I get this data from? I don't remember. I googled something and found numbers and called it good enough I guess. Anyways there are only three disorders, those two and "Sleepy Bitch Disorder" Which is :\ well that's not a lot. But! I remember asking a few times for things to add, and no one submitted things, and those were just the three I added in to test the feature out. BTW your dragon could potentially have all disorders at once. It's not very probable but it could happen.
Also I absolutely had bias stuff in some of the results, such as for common pronouns and creatures. I have removed all those biases for v2.0.0 👍
Looking at the Hydra code and 😬 that's a lot. Like, it's not hard to understand, there's just a lot with it. Every time a head is added, it cuts the percentage in 1/2 for the next head, and then the final head count needs personalities for each head. But not every thing is multiplied either. Hydras are in v1.1.0 tho, and I never finished them 😔 In fact v2.0.0 might not include them, we'll see how that goes.
Anyways I've started on cleaning up v1.0.2 so that I can understand things easier for when I make the web version. Until then . ..
It'll still be one every 3 hours, so 8 Dragons a day. All the old copyright rules still apply, anyone can use any creature that spits out. I have a .bat file that'll run the Python program 250 times in about 5 seconds, which'll make 31.25 days, basically lasting us until 2025
Also I'll be setting up a bunch of proper blog tags over the next week or two, and update the pinned content as well. Reviving an abandoned blog is a lot of work :P
7 notes
·
View notes
Text
I didn't quite get all my tentpole goals for my programming language project done this weekend, but I got much closer than I originally expected! I'm hoping to have transpilation to C ready by the end of my week to show my friend. I did start setting up program entrypoints in uv, though, and there's something emotionally magical about typing into the stdin of a process, and have it spit out a processed version of your input. Like... oh my god! That's my lexer, and my parser! They work! This is a thing I can play with now! This process is also forcing me to confront some things earlier than I expected, like the way the built-in Error type works. In the earlier prototype this was basically just an enum of a couple options, and no further detail. But needing to represent errors as a C type has pushed me to actually make them structures with multiple fields:
Format string (TODO: printf format rather than Python format), in the final version this will usually be a pointer to a static piece of memory.
Format args.
Parent error (allows for printing a whole traceback).
I wouldn't say I'm thrilled by how much I'm currently having to use PyObject* as a gross hack in my structures right now, but it helps my code play nice with the Python garbage collection infrastructure, and should make it possible to incrementally migrate to a C implementation later.
3 notes
·
View notes
Text
Coding Update 6
I think its been a while since I've updated. I fell behind a little on my learning cause life has been really difficult lately.
Hope y'all had a good Thanksgiving and having a good start into the holiday season!! Yadda yadda more under the cut.
So I just finished Part 1 of my book. This mostly contained the introduction to Python, obviously, while learning a lot of the major functions of the program. I think it took me a bit to get into the swing of coding, especially cause it felt like I've had to rewire my own brain doing this haha.
The good news is I feel a LOT more comfortable with Python now. Not like "i can do anything!" yet but enough that it's actually super fun and I'm excited to work on projects!
The last part of the chapter taught me to use the "pytest" ability. I.E: writing test code so that I can make sure my programs are working properly and as intended. That part was really interesting, mostly because it was super duper busted at first for me.
That ended up being because where my "default folder" is set is like my main python hub, so i have to use the uh. What's it called? True access link? Where I write the entire string to the code's location.
Which also taught me that in the Terminal I have to use quotes for the location cause before I learned proper coding practices, I used spaces in some of the initial folders.
We're good now though.
The next part, Part II, is all about learning to build fully functional projects!! I'm so HYPED. There's four projects, of which it was like choose whatever you want! But I'm gonna start with an Alien Invasion remake. You know, the game where you're the little ship at the bottom shooting at aliens as they slowly decend on the screen. I should learn a lot from this one.
The other project I'm looking forward to is a simple online blog database. It'll have users create accounts, be accessible online, and you can make little journal posts! That should actually teach me a lot of stuff that I want to do.
There's another for data visualization, which I think I'll send to my cousin. He works in a lab at MIT and I know they use python for their programs. Maybe I can work my way into his work by doing that lmao.
Anyway, I'm really excited for all of this. It should teach me a ton of usable skills, and then i can add these projects to my portfolio to show off. Also I can spin off and make my own stuff.
Also also, if anyone wants to help me test my projects, feel free to let me know! I already know a few who are more than willing, but I'd appreciate any and all feedback as I go.
Oh! It also recommended learning version control, which I know almost nothing about. So I'll learn how to use GitHUB to store projects and recall old ones as I go if things break horribly. Which will be fun! Cause I know that for sure is going to be an important skill to have.
For a last fun fact, did you know places are like "requirements: typing 30 words per second." Do you know how fast I can type? At my peak I'm like over 110. I baseline at like 95. I don't know if that's actually fast but it makes me feel like the specialist little guy.
I hope you all have a good holiday season. Sorry no code in this post, I'm writing it so I can give you all an update, and I'm dog tired today. But but I promise to snip actual code for you as I go forward. And It'll be fun, especially cause this alien project will teach me about making VISUAL things!
Seasons Greasons Tumblr! -Kit
6 notes
·
View notes